package br.com.cadele.service;

import java.io.Serializable;
import java.util.ArrayList;

import br.com.cadele.dao.CursoDAO;
import br.com.cadele.model.Curso;

public class CursoService implements Serializable{

	private static final long serialVersionUID = -4401358834847651044L;
	private CursoDAO cursoDAO;
	
	public CursoService() {
		cursoDAO = new CursoDAO();
	}
	
	public ArrayList<Curso> getAll(){
		return cursoDAO.executeQuery("SELECT * FROM Curso");
	}

	public void executeInsert(Curso curso){
		StringBuilder query = new StringBuilder();
		query.append("INSERT INTO Curso VALUES ('");
		query.append(curso.getCodigo()+"','");
		query.append(curso.getNome()+"')");
		cursoDAO.executeSQL(query.toString());
	}
	
	public void executeUpdate(Curso curso, long id){
		//TODO
		cursoDAO.executeQuery("");
	}
	
	public void executeDelete(Curso curso){
		//TODO
		cursoDAO.executeQuery("");
	}
}
